#ifndef SYSDIALOG_H
#define SYSDIALOG_H
#include <QtGui>
#include <QProcess>
#include "showlabel.h"
#include "mybutton.h"
#include "showtoday.h"
#include "daydata.h"
#include "showaqi.h"
#include "sysset.h"

#define ROOT_P 0


#define LEN 1024

#define DAY_FILE "/home/pi/day_file"
#define WEEK_FILE "/home/pi/week_file"

class SysDialog : public QDialog
{
    Q_OBJECT
public:
    SysDialog(QWidget *parent=0);
    int DevInit(void);
    void init_com(int fd);
    int da_pro(char* da_buf);
    int read_dht(unsigned char* U8_data);
    int get_dht_data(void);
    int get_day_value(void);
    int get_week_value(void);
public slots:
    void updateSYS(void);
    void goShowToday(void);
    void goShowWeek(void);
    void goShowAqi(void);
    void goSet(void);
    void setHour(int);
private:
    QProcess *myProcess;
    int temp_timer;
    int net_timer;
    int flag_time;
    int hourNum;
    QLabel *label_pic_bg;
    int fd_pm25;
    int fd_dht;
    int temp;
    int humi;
    QString info;
    ShowLabel *sysTime;
    Button *today;
    Button *week;
    Button *aqi;
    Button *systemSet;

    /*
    QLineEdit *linePM25;
    ShowLabel *sysTime;
    QLabel *sysDate;
    ShowLabel *temp;
    ShowLabel *insideData;

    ShowLabel *netTemp;
    ShowLabel *weather;
    ShowLabel *netData;
    QLabel *weatherIcon;
    */
    ShowToday *showToday;
    DayData *showWeek[7];
    ShowAqi *showAqi;
    SysSet *sysSet;

    QString weekArr[6][8];
    QString dayArr[16];
    QString aqiArr[5];
};

#endif // SYSDIALOG_H
